xen/arm: mm: Rework Xen page-tables walk during update
authorJulien Grall <julien.grall@arm.com>
Thu, 4 Apr 2019 18:01:29 +0000 (19:01 +0100)
committerJulien Grall <julien.grall@arm.com>
Sun, 16 Jun 2019 20:24:45 +0000 (21:24 +0100)
commit53abb9a1dcd99d28ffd0b62e5982a1e82460d288
treeb5e4cd0b5bf294c6b134ca405125323f54aadb17
parent771bb0dab0faf90705d738aacfd4cb2786bd3ad2
xen/arm: mm: Rework Xen page-tables walk during update

Currently, xen_pt_update_entry() is only able to update the region covered
by xen_second (i.e 0 to 0x7fffffff).

Because of the restriction we end to have multiple functions in mm.c
modifying the page-tables differently.

Furthermore, we never walked the page-tables fully. This means that any
change in the layout may requires major rewrite of the page-tables code.

Lastly, we have been quite lucky that no one ever tried to pass an address
outside this range because it would have blown-up.

xen_pt_update_entry() is reworked to walk over the page-tables every
time. The logic has been borrowed from arch/arm/p2m.c and contain some
limitations for the time being:
    - Superpage cannot be shattered
    - Only level 3 (i.e 4KB) can be done

Note that the parameter 'addr' has been renamed to 'virt' to make clear
we are dealing with a virtual address.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Andrii Anisov <andrii_anisov@epam.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/mm.c